#include <hplanner_ompl/reasoning.h>
#include <stdio.h>

int main()
{
  unsigned int dim = 2;
  float lambda = 1;
  float v[2] = {0.6, 0.8};
  float o[2] = {0, 0};

  unsigned int N = 100;
  float* data = new float[2 * N];
  bool* type = new bool[N];

  for(unsigned int i = 0; i < N; ++i)
  {
    data[2 * i] = rand() / (float)(RAND_MAX) * 3;
    data[2 * i + 1] = rand() / (float)(RAND_MAX) * 4;
    if(rand() / (float)(RAND_MAX) < 0.5) type[i] = true;
    else type[i] = false;
  }

  cspace_learning::LinearClassifier_Bisect classifier(dim);
  classifier.reset(v, o);

  for(unsigned int i = 0; i < N; ++i)
  {
    classifier.addItem(&data[2 * i], type[i]);
  }

  classifier.train();


  cspace_learning::LinearClassifier_SVM classifier2(dim);
  classifier2.reset();

  for(unsigned int i = 0; i < N; ++i)
  {
    classifier2.addItem(&data[2 * i], type[i]);
  }

  classifier2.train();


  return 0;
}
